home *** CD-ROM | disk | FTP | other *** search
- '**************************************************************************
- '* MSSetup Script for the KODAK PRECISION MICROGRFX Starter Pack
- '**************************************************************************
-
- '$DEFINE DEBUG ''Define for script development/debugging
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
- '$INCLUDE 'msshared.inc'
-
- ''Dialog ID's
- CONST WELCOME = 100
- CONST ASKQUIT = 200
- CONST TOOBIG = 400
-
- CONST WINDOWSVERSION = 600
- CONST WINDOWSMODE = 610
- CONST PROCESSOR = 620
-
- CONST EXITFAILURE = 700
- CONST EXITQUIT = 710
- CONST EXITSUCCESS = 720
-
- ''Bitmap ID
- CONST LOGO = 1
-
- GLOBAL WinDir$
- GLOBAL WinSysDir$
-
- DECLARE SUB Install
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
-
-
- INIT:
- CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
-
- SetBitmap CUIDLL$, LOGO
- SetTitle "KODAK PRECISION MICROGRAFX Starter Pack"
- SetAbout "KODAK PRECISION MICROGRAFX Starter Pack", "Copyright Eastman Kodak Company"
-
- szInf$ = GetSymbolValue("STF_SRCINFPATH")
- IF szInf$ = "" THEN
- szInf$ = GetSymbolValue("STF_CWDDIR") + "starter.inf"
- END IF
- ReadInfFile szInf$
-
- WinDir$ = GetWindowsDir()
- WinDir$ = MID$(WinDir$, 1, LEN(WinDir$) - 1)
-
- WinSysDir$ = GetWindowsSysDir()
- WinSysDir$ = MID$(WinSysDir$, 1, LEN(WinSysDir$) - 1)
-
- '$IFDEF DEBUG
- i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
- WinDrive$ = MID$(GetWindowsDir, 1, 1)
- IF IsDriveValid(WinDrive$) = 0 THEN
- i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
- GOTO QUIT
- END IF
- '$ENDIF ''DEBUG
-
-
- WELCOME:
- sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", 0, "")
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- ELSE
- GOSUB ASKQUIT
- GOTO WELCOME
- END IF
-
-
- WinVersion:
- IF GetWindowsMajorVersion() < 3 THEN
- sz$ = UIStartDlg(CUIDLL$, WINDOWSVERSION, "FInfoDlgProc", 0, "")
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- ELSE
- GOSUB ASKQUIT
- GOTO WinVersion
- END IF
- ELSE
- IF GetWindowsMinorVersion() < 1 THEN
- sz$ = UIStartDlg(CUIDLL$, WINDOWSVERSION, "FInfoDlgProc", 0, "")
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- ELSE
- GOSUB ASKQUIT
- GOTO WinVersion
- END IF
- END IF
- ENDIF
-
-
- WinMode:
- IF GetWindowsMode() < 2 THEN
- sz$ = UIStartDlg(CUIDLL$, WINDOWSMODE, "FInfoDlgProc", 0, "")
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- ELSE
- GOSUB ASKQUIT
- GOTO WinMode
- END IF
- ENDIF
-
-
- Processor:
- IF GetProcessorType() < 3 THEN
- sz$ = UIStartDlg(CUIDLL$, PROCESSOR, "FInfoDlgProc", 0, "")
- IF sz$ = "CONTINUE" THEN
- UIPop 1
- ELSE
- GOSUB ASKQUIT
- GOTO Processor
- END IF
- ENDIF
-
-
- Install
-
-
- QUIT:
- ON ERROR GOTO ERRQUIT
-
- IF ERR = 0 THEN
- dlg% = EXITSUCCESS
- ELSEIF ERR = STFQUIT THEN
- dlg% = EXITQUIT
- ELSE
- dlg% = EXITFAILURE
- END IF
- QUITL1:
- sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO QUITL1
- END IF
- UIPop 1
-
- END
-
- ERRQUIT:
- i% = DoMsgBox("Setup sources were corrupted, call 800-752-6567 or 508-670-6877", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
- END
-
-
-
- ASKQUIT:
- sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
-
- IF sz$ = "EXIT" THEN
- UIPopAll
- ERROR STFQUIT
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO ASKQUIT
- ELSE
- UIPop 1
- END IF
- RETURN
-
-
-
- '**
- '** Purpose:
- '** Builds the copy list and performs all installation operations.
- '** Arguments:
- '** none.
- '** Returns:
- '** none.
- '*************************************************************************
- SUB Install STATIC
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
-
- '** Locate location for CP files
- KpcmsIni$ = MakePath(WinDir$,"kpcms.ini")
-
- '** check for kpcms.ini, create default one if not found
- IF 0 = DoesFileExist(KpcmsIni$, femExists) THEN
- KpcmsIniSrc$ = MakePath(SrcDir$,"kpcms.ini")
- CopyFile KpcmsIniSrc$, KpcmsIni$, cmoVital, 0
- ENDIF
- '**
-
- Drive$ = GetIniKeyString(KpcmsIni$, "KEPS Precision", "DRIVE")
- IF Drive$ = "" THEN
- Drive$ = "C:"
- ENDIF
-
- '** Add DLLs to copy list
- AddSectionKeyFileToCopyList "DllFiles", "Shared", SrcDir$, WinDir$
-
- '** Get directory for CP files
- CPDir$ = GetIniKeyString(KpcmsIni$, "KCP", "CP_DIR")
- IF CPDir$ = "" THEN
- CPDir$ = "\kpcms\cmscpi\"
- ENDIF
-
- CPPath$ = Drive$ + CPDir$
- CPPath$ = MID$(CPPath$, 1, LEN(CPPath$) - 1)
- CreateDir CPPath$, cmoVital
-
- '** Add CP files to copy list
- AddSectionFilesToCopyList "CPFiles", SrcDir$, CPPath$
-
- '** Get directory for PTs
- PTDir$ = GetIniKeyString(KpcmsIni$, "KCP", "PT_DIR")
- IF PTDir$ = "" THEN
- PTDir$ = "\kpcms\dcpdb\"
- ENDIF
- PTPath$ = Drive$ + PTDir$
- CreateDir PTPath$, cmoVital
-
- '** Add PT files to copy list
- AddSectionFilesToCopyList "pts", SrcDir$, PTPath$
-
- '** Get directory for READMES
- READMESPath$ = PTPath$ + "READMES"
- CreateDir READMESPath$, cmoVital
-
- '** Add Readme files to copy list
- AddSectionFilesToCopyList "readmes", SrcDir$, READMESPath$
-
- CopyFilesInCopyList
-
- GetOut:
- END SUB
-
-
-
- '**
- '** Purpose:
- '** Appends a file name to the end of a directory path,
- '** inserting a backslash character as needed.
- '** Arguments:
- '** szDir$ - full directory path (with optional ending "\")
- '** szFile$ - filename to append to directory
- '** Returns:
- '** Resulting fully qualified path name.
- '*************************************************************************
- FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
- IF szDir$ = "" THEN
- MakePath = szFile$
- ELSEIF szFile$ = "" THEN
- MakePath = szDir$
- ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
- MakePath = szDir$ + szFile$
- ELSE
- MakePath = szDir$ + "\" + szFile$
- END IF
- END FUNCTION
-